package com.wakala.employment.http.bean;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.List;

public class CategoryMenuVo implements Parcelable {
    private Integer id;

    /**
     * 名称
     */
    private String name;

    /**
     * 图标
     */
    private String icon;

    /**
     * 类型 1=找活导航菜单  2=招聘导航菜单 3=会员菜单
     */
    private Integer type;

    /**
     * 链接地址
     */
    private String url;

    /**
     * 目标 1=工种  2=标签 3=关键字 4=页面
     */
    private Integer target;

    /**
     * 排序
     */
    private Integer sort;

    /**
     * 扩展属性，配置的工种ID列表
     */
    private List<String> jobCategoryNames;

    /**
     * 扩展属性，配置的职位标签列表
     */
    private List<String> jobTags;
    /**
     * 扩展属性，配置的关键字标签列表
     */
    private List<String> keywords;

    public CategoryMenuVo(){}

    protected CategoryMenuVo(Parcel in) {
        if (in.readByte() == 0) {
            id = null;
        } else {
            id = in.readInt();
        }
        name = in.readString();
        icon = in.readString();
        if (in.readByte() == 0) {
            type = null;
        } else {
            type = in.readInt();
        }
        url = in.readString();
        if (in.readByte() == 0) {
            target = null;
        } else {
            target = in.readInt();
        }
        if (in.readByte() == 0) {
            sort = null;
        } else {
            sort = in.readInt();
        }
        jobCategoryNames = in.createStringArrayList();
        jobTags = in.createStringArrayList();
        keywords = in.createStringArrayList();
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        if (id == null) {
            dest.writeByte((byte) 0);
        } else {
            dest.writeByte((byte) 1);
            dest.writeInt(id);
        }
        dest.writeString(name);
        dest.writeString(icon);
        if (type == null) {
            dest.writeByte((byte) 0);
        } else {
            dest.writeByte((byte) 1);
            dest.writeInt(type);
        }
        dest.writeString(url);
        if (target == null) {
            dest.writeByte((byte) 0);
        } else {
            dest.writeByte((byte) 1);
            dest.writeInt(target);
        }
        if (sort == null) {
            dest.writeByte((byte) 0);
        } else {
            dest.writeByte((byte) 1);
            dest.writeInt(sort);
        }
        dest.writeStringList(jobCategoryNames);
        dest.writeStringList(jobTags);
        dest.writeStringList(keywords);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<CategoryMenuVo> CREATOR = new Creator<CategoryMenuVo>() {
        @Override
        public CategoryMenuVo createFromParcel(Parcel in) {
            return new CategoryMenuVo(in);
        }

        @Override
        public CategoryMenuVo[] newArray(int size) {
            return new CategoryMenuVo[size];
        }
    };

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public Integer getTarget() {
        return target;
    }

    public void setTarget(Integer target) {
        this.target = target;
    }

    public Integer getSort() {
        return sort;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }


    public List<String> getJobTags() {
        return jobTags;
    }

    public void setJobTags(List<String> jobTags) {
        this.jobTags = jobTags;
    }

    public List<String> getKeywords() {
        return keywords;
    }

    public void setKeywords(List<String> keywords) {
        this.keywords = keywords;
    }

    public List<String> getJobCategoryNames() {
        return jobCategoryNames;
    }

    public void setJobCategoryNames(List<String> jobCategoryNames) {
        this.jobCategoryNames = jobCategoryNames;
    }
}
